CFY-959 extract some code to base handler