refactoring for faster response