extract changed to handbook.py and some tests added for it