Refactor of remove-keys and remove-vals to be more concise