File refactory