yass.js refactored