Converted to ajax and added ajax templates