Refactored alert method and checked for valid parameters in method call
Janitor clean up