rebuild some functions