moving move logic to the library and client side