Moved some JS stuff around