Cleaning up old code based on model refactoring