[refactor] extract out stage finding method