Revert "minor improvements of performance"

This reverts commit 1e3f419dda9f8a6ea2f64fc24c3500de189cca06.