Refactored the clndr.js setup code.