separate ajax and template into files