Fixing up colletions, factories and cleaning up deprecated methods from models.