Added afterInit function for automated model tasks.