Refactor on Selection Sort