Refactored eject method