Moved remove whitespaces logic to model layer