sdl loop actions, better logging, refactoring