Improved window management