start migrating into a reusable lib