incremental improvements to bin/createReference.py