refactoring minefield