editor_native/main.cpp refactored