refactor file modification spec hooks