re-factoring

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