share some useful code