Refactored system i/o read and write, simplified control functions.