cleanup and optimization of interactive behavior