refactoring the books view