(chore) Refactor ActiveUsersIterator to extract the query builder from the querying + result handling - #590