refactors config mechanism and the way messages are built