moved update logic to codelibrary