Refactor configuration.
Add hooks & handlers classes.