Refactored the entityrepository and removed the entityfactory.