Added toasts, optimized code