Refactored so that different number of voices is dealt with in a single class