multimodule support. code needs to be cleaned up