plotting directories refactor