Refactoring & KC timeout fix