Refactoring to avoid blocking requests