a little runtime cleanup and bookkeeping