Refactor according to line notes