refactoring book controller