cleanup
refactored initialization and configuration to allow config changes at run time