changed to handle module pattern.