Specify imports, remove unnecessary parens, use more efficient dictionary initialization