performance improvements per issue #4