search implementation. Also cleaned up class names