More refactoring of Shape class