Window calculations improvements