compartmentalize the window and renderer