moved main method into separate class