Moved static functions to end of file