made some dict based operations faster