Deciding what part of separated path to keep and what to delete