modifed some method to public.