move messages functions to relevant file