Feature/convert to lib