Extracted array swaps to a seperate util class