sdl_engine refactoring