Refactored processing overlap key candidate code for better readability