Some cleanups and ui stuff