Refactor sdk setup