refactor some functions
add missing linebreak
implement a IOHandler instead of static functions
Merge pull request #6 from Doomsta/handleInAndOutput

handle in and output at only one point