Refactor to check for yaml and json libs in config.