refactoring of function calls