introducted centralized functions in order to avoid repeating code for
retrieving users