Code refactored. SDLApp added.