move javascript to separate file