refactor moving lines in all indexes