Replace %query with $self->query