Adapted code to use constructor stage guards