Remove a condition for checking the type of node in inline condition
Remove duplicated code