first test passing, refactored