refactor bibs.py. adjustments to source files.