moved clean objects function from header to .cc