rm duplicate code