Looks like duplicate code from above.  Also, is there any way to put this logic in the model?