Refactored common activation code based on suggestions from @jbau.
Added trailing commas per @stvstnfrd