Refactoring StoreController

Refactoring for Google IABv3.
The original code is too complex.