Improve window managament