Refactor two three of a kinds and three pairs