refactored client side alerts into a library