extract rename functionality into class.