Refactor numberOfArguments to be visible throughout the function