Refactor Radix sort