Implemented Entity Factory.