minor fix
small optimizations