Don't use macros for type registration.
Remove duplicated code in texture loading.
Make object creating during serialization configurable.