Added modular support for main implementation.