refactored how we were handling newlines