removed extra getState call in find
move switch outside of find logic to improve speed.