Refactor sdk