Reporganized, added support for unloading handlers