Moved input logic into the new UI layer