improve python template