Managing application life cycles