Refactor file action performed and make analysis static