common functions used in puppet