refactor book.rb