(refactor) Add helper query

@armandopmj