Some useful functions

+cleanup