Refactored shapes.py