Moved UI setup to rendered event