Slight refactoring here and there.
Adding IO