Cleaning up JS calls