update and cleanup to library side login