porting framework code from v3