Strip redundant whitespace after building the class string