update example config
general code refactoring