separated parser and openFile funcs