More static functions and tests