optimising of inline JS