remove redundant compareText function