Added segment.io and refactored config to be reusable.