tidies up and lints some js