Added WindowManager
- more code cleanups