Removing trailing spaces and unnecessary