cleanup and bug fix for tablet UI