Code cleanup

Code cleanup - module pattern

Code cleanup - module pattern