clean some functions and add interactions among them