DRY a little and make more like Python code