remove extraneous variable declarations and initialisation