Moved render logic into directives.