renamed some functions for clarity