Added lifecycle callbacks for init and destroy methods.