should we move these function declarations above the calling code? what's the normal js practice?