moved variable initializations into constructors