it: move flow control to separate subroutine