use tresql result instead of map as querease io, refactor