removing a duplicated subroutine