Endpoint class in a separate file and added phase_id helper method