Refactor books