This allows to apply the mode atomically and adds possibility of defining custom modes (to be implemented).