refactor logpy simplify to use isinstance lists