add private_url & put_file methods; refactor some code