Cleaned up and optimized wfBaseConvert();