added ability to use config object