cleanup, abstracted subroutines