readability that hotSwapState is optional