refactoring use nio Path