For SVY-6997: Moved function declarations before usage as otherwise it
breaks in FF.