Refactor some lines