Bring in Nio code to be refactored