clean up. added log levels.
code tracing.