refactored metric sender into seperate package