allow config to be passed in