Refine codes and settings.