updated config parsing for middleware