code cleanup and ui changes