Little code re-structuring for GCC compatibility