move urlsafe_uid function to its own module