Issue: #1
- Refactored the run method and created the mainLoop one.
- Removed unnecessary window variable and used the member one.