Improve chat form performance

Should help with #266