refactored test for convenience