convert to NIO for #20 -- still unsure as to whether this is justified