backported changes to IUserRepository from v7