refactoring the strip whitespaces