Function definition and calling refactored.