refactoring. bugfix. replace entities list from db to code