refactoring entity use of container