Fixes: #2897 Show hooks output
Fixes: #2595 Cleaning some code