Refine the book management function