More work on patterns factory.