extracted main method to Main class