cleaning whitespace and standardize sql