use more pattern matching in solutions, add more tests for safe refactoring