removing unnecessary files and implementing recursive ajax calls