refine the functions
delete func works well