cleaning up, restructuring, removing dead code
IO tweaks