Simplify window calculation