more sensible imports
avoid dictionary comprehension to maintain 2.6 compatibility
use set constructor to be 2.6 compatible
manually check if None for 2.6 compatibility