implement _fparse functions
simplify the file parsing functions