code clean up and user interface improvements.