better bug sharing among functions