compiler: js: some improvements for models