Added code for automatic type definitions