add config.c and refine config.h