Refactoring i-ajax block