Implements remove logic