I dont like the fact that the code is in the controller, I'm wondering if its better to have a wrapper class, that handle that internally, and use that wrapper class as an API instead of directly talking to the hostgroup model?