refactoring configuration and tests