refactor by players query