Refactored the bundle activator.