some performance enhancements needed for tode only