Restructure authentication model