change declaration style of js classes to use function()