Created some ajax and further improve template