Refactoring: extract prepare voice intervals function