Moving resolve_snippet logit to separate class.