Refactor and reduce