[FEATURE] Refactor computation of private and public generators to functions.