Set up start and stop handlers