Refactors removeNodeWithKey signature