entity facade generation and refactoring