Helper function for push registration

Here is the actual change (the gen/* files are generated from this one)