refactored some more for responsiveness