Make javascript a bit more consistent across various scripts