separate logic into service

I wanted to do this in hopes of writing a unit test,
but this is very difficult given that we are dealing with the
underlying security framework and GORM.  Will have to think about
this one a bit.