Minor changes in comments and names of variables. Also re-factoring of method authenticate_ids.