implemented unit of work