little refactoring on remove()