Move macro definitions close to their related function definition