clean up js syntax