Reorganization of the code for easier maintenance
Converted interface to use click library