Modified the extend function, added callbacks & components