Refactored config and added test