rearranged js calls