Add config example

Refactor boilerplate code a bit