Collection some useful functions