Adapted code to work with new yaml format