maybe even assemble functions from JS and call them later from JS?