[refactor] Minor removal of code duplication and changed a name to be more clear.