changed to module pattern