Entity class refactored.
Refactored to work with factories.