optimize version checks