refactor SceneManager.