Refactoring. Reduce amount of SQL blocking requests