since both use the same if, it would be clearer if you have a single if ... end block.