A couple quick performance improvements

many TODOs

Signed-off-by: Jack Huey kitskub@gmail.com