clean up big elsif mess