allowing settings object to be passed in