it: python: simplified code