implement case parsing