fixed issue with attach hooks to base model object and having them execute properly on model instances
general refactoring