books refactor