Restructuring to use sub-module formula