re-factoring

-- conditional operator simplified
-- unnecessary local variable editor removed

thanks :)