Use method generatePrivateUrl instead of copy-paste