Refactored books controller

The problem is that I believe you changed from something that was ok into something that's wrong. But this discussion should not hold the pr.