Factor out dangerous input type in messages and normalize

Remove some duplicate code from checks!