added unitofwork and rewrote the repositories