remove useless code; fix error; add config file