removed useles else branches