Remove entity and refactoring