refactor for librato, etc