refactoring required for attribute math largely in place