refactored config and testing