Condense some js