add unified renderer, fix some bugs