reduce remove functions to one