move attachment type logic into common service
Merge pull request #371 from just-boris/master

move attachment type logic into common service