added support code for enchantment mode
refactored config management stuff