adding better "fullscreen" mode and some refactoring