I'm leery of how many conditionals are being nested, this should probably be expanded to have separate cases for when the config is a Hash or String.