Restructure the codes and make runant workable