refactored redefine_render