Refactored custom modules support.