moving file utils to functions