[hearthstone] [skip ci] - Refactor code.