bill function refine