moving markup code to partials
refactoring alerts creation to handle ajax request