Finish first cut of backend refactor