refactored code to have addSubmodule and updateSubmodule functions instead of submodule object