Refactor getAllAlignments()