early-returns in subfunctions