Refactored entity name autocompletion, and moved logic in an outside class