make the python less duplicative