Better way of passing around window dimensions