a bit of refactoring around entityaccess