Replace coffee script with javascript