Added helper method to execute a function on each the model