Remove duplicated config lines and whitespaces