Formatting javascript calls