Authentication and cleanup