refactor, and add base remove functionality