refactoring; fixed NullPointerExteption; added external YAML prefs