Remove trailing whitespaces and previous_date because is assigned but never used