Modularise window management