Refactor four and five of a kind