Refactoring to help SWIG digest the headers with templates