move startup in to a main method