NIO refactoring.