Refactoring Rects and added some util methods