Move afterInitialize and beforeSave hooks outside on attached event.