Skip empty recs
refactor docparser a bit
extract some common logic
more refactor