Added functionality for automatic type registration, instead of big if list