before switch to core data