Moved path creating to method

[fcc07c9d15fb055b630140e2d6009b826a05964e]