modelizer.js refactored