add comments to help refactor
use config
clean
remove useless return value