[MIG]migrate to new api

[IMP]remove unneccessary stuff

[IMP]remove dead code