Update UI and code