simplifying main method