entities refactor 2