some performance fixes here and there