some common function