some optimizations, about 30% faster
Rename for better packaging