protocol change and code restructuring