Refactored the render method in UI.js

Sorry for the indents, my editor was not being cooperative