Moved global define into class constant, replaced a bunch of $fname with __METHOD__.