Refactor 'remove element' again.