MB-141 #comment removing magic and turning it into function