Refactored the config handlers into separate source file