Remove useless calls and trailing spaces