refactoring with remove