code modernization: sorted imports, use decorators, utf8 headers.