add extend func where it required (instead of Object.create)