Crafted for square and refactored