tidied up renderer
extracted window creation into separate struct