NIO creation refactoring.