simplify a little (thanks @tomchentw)