Move to composer
Abstract out to library