found possible way to refactor out case