minor refcatorings, pep8 core and test_check