removing lines with utility function