before insertline deleteline refactor