before implementing chat history functionality

minor optimizations