Added YAML configuration. Refactored.