Refactored messaging into a base APIs