Extracted orderByDependencies method into separate helper class, so method can be reused in other places