minor refactoring: 5% perf. boost
minor refactoring