Refactor book management