refactor to work with new sdk + add framework