Fixed trim error.
Refactored author, book and chat models to use generic model.