Optimization in lf_parse function