Use environment repository instead of user->getEnvironments()