Refactored slot finding functions.