i think we could replace most of this with something like `str.split('\n').length`