this is the js version of generica