pep8 code, remove unnecessary imports and set patt without __init__