Improve some conditional in the builder.js

Some conditional in the `lib/builder.js` have admit of improvement.
It'll be more readable and efficient by this changes.
Merge branch 'improve-conditional'