Refactor v4 generator and hints descriptor