Separated schema from controllers and refactored routes to be generated by controllers