Refactor composite finder, move inner classes outside