Refactor slightly