Better code layout and adding Javascript file