refactored test for speed