process options in separate subroutine