basis.entity: refactor entity instance work with indexes