Refactoring to support multiple products (with minimal product specific ...

...hacks)