moved CoreData codes from app delegate to a focused class DataManager