Removed unnecessary elseif
A little refactoring