Simplified the Object remove function.