refactoring, geometry, elimination of magic numbers