started code-cleanup, fixed output for '--export'