minor refinements to the s3 parsing
consolidated a couple functions
Merge branch 'dk'