refactored with the simplified testing