Factor circle.py into parts