move window functions into own class