separate js script from UI