code cleaning: factorization & suppression of useless lib
using post request to get access token instead of curl :P