add multi-module optimize support

try to support multi-module optimize