small re-architecturing via module pattern