Major refactoring complete - window should work