Refactored config service, improved tests