refactor book test