some useful code frequently used!