remove compiler-dependent complex code

Switch to the more portable method.