Simplify file function