Refactored rectangle properly