Refactor codes
Add comments
Refactor conf file
Add tests