Start to refactor the oAuth code and merge libraries into one