code polishing for pylint, trying to get rid of circular imports