Added request generation. Split state into internal and public.