Replace dictionary comprehension which is not supported on Python 2.6