MNT: Renamed function and variables to be more general