Refactor

this can be a problem too. we don't control number of executed queries, if there is no need to.