Move resolution finding to own function