Refactored config module