simplified remove function