refactoring decorator
added ajax middleware class