cleanup and ui

cleanup

removed globals