Simplify file input and output