Refactored window commands