Refactoring path to be stored in an array rather than a string