Add arguments and refactor function.