createt javascript "service" with util functions