refactoring to prevent users array from getting too large