refactor three lines