refactor string compare for readability