some initializations and minor cleanup