Refactor sceneMain & fix profiler bug