refactoring, style fixes, config example