Refactoring, use EmptyPath and NonEmptyPath in Node