split window.cpp into separate files