refactored function calls