clean up codes and generate a skeleton for normal use.