python simplifications