Move compiling YAML to its own method