started to move window functions to a class