simplify main method