Tidied up instagram api helper code