Start on refactor to minimal migration and tested lib