Refactoring alertview