cleanup some function