convenience function for file reading