Factor out prime module