Refactoring; add class with main method