Refactoring.
Adding common interface for IO functions.