add options to rm
remove duplicate subroutine and combine
cleanup