use tuples when string formatting, and isinstance when checking types