moved translation of file to Document into its own class