These string comparisons will have to go, they are far too expensive.