Cleanup activity start/stop code