add state transfer and refactoring