Script refactored using the Module pattern