Move the code for each entity into its own file.