F1: Make code refactoring.

Refactored Window class.