Refactoring to use Lifecycle
Renaming for consistency
Various test fixes