Style fixes  and simplification of test for dispatch