ENH: move processing routines from tool to logic