refactor borrowing and returning entry