improve removing newlines