some optimizations
fix constants names