Updated to support polymorphism and autoloading.