refactoring, minimal tests