minor optimizations or typos

see commits