Generator refactoring
Fix refs subdocs generator :)