minor performance optimizations and TODO items