Docs comment and a more elegant type switch