Refactoring TrieMap including using Java 8 features