Better handling of RelayrApp lifecycle