Converted to use of config object

Designed to allow for the use of callback handlers.