Refactored the slot imlementation code