Added replaceModule method