Refine authentication mehcanism