Upgrade library from v1 to v2