Separated and refactored to include different queries for online players versus all players