continue refactoring - moved test fn to helpers.js