Abstracted inline JS helper to class #3282