Remove unneeded empty string
Move trim into firstLineOnly