update code to refactor by adding new class Book and test
add refactoring