Removed unnecessary _get_mode function