Tidy up and document control flow a little better.