Made the warning dismissable

Made the warning dismissable and refined some code