Refactoring

Extensive refactoring in order to:
+ Separe gui and main classes
+ Returning more rational result types