Refactor/config

fixes #216