Move CoreData helpers outside