Authentication and cleanup work.