refactored search state classes as inner classes of Search