Enhancement/192/refactor ajax handler