DRY out book.py, minor changes to main.py