optimizing issue #25