Refactor YAML database