Move window-based functionality to a function assured to be after initialization