demonstrate subroutine extraction