modified internal functions file for clarity