Refactor to lose elsif.