refacored CoreDataManager