Refactor code & and config file
Simplify & some minor fix