refactor subroutine classes to make room for functions