separate public and private messaging

- public and private messaging moved to separate controllers
- refactored repeated code into functions