refactoring where