Handle precedence correctly and elegantly