A simple example of "factory" pattern.