rewrite old ui prototype code for ratchet v2