Changed JS structure