spu: handle stop better, split main func more