move main method, add constructors