Improved file parser