refactor series-specific stuff out of Query into QueryCommand