Refactoring coredata entities