Managing lifecycles using stackable traits