restructured main, cleaned up messaging