Simplify writing to file