Refactored into (weirdly recursive) formula shape