Factor indirect comparisons.
Ensure 'bin' directory exists.
Use make_shared and nullptr.