Introduce Main class
Refactor methods and make extensible