replace two case switch with if
some light refactoring
validate comment and spf strings
remove extra noise from test outputs