move javascript to file, homepage refactor