General callback and cleanup work