more refactoring, filtering whitespaces