switch if/else per David's review comments