moving main method into Application