Make this object oriented; if this code is only used to return a `Window` then convert this into a subclass of `Window`.