better window implementation