More refactoring, make YAML parse