Clean up source code.

Require less user interaction.
Still need log file improvement.