In this paper, we give a new direct proof of a result by Bobtcheva and Piergallini that provides finite algebraic presentations of two categories, denoted 3\mathrm{Cob} and 4\mathrm{HB}, whose morphisms are manifolds of dimension 3 and 4, respectively. More precisely, 3\mathrm{Cob} is the category of connected oriented 3-dimensional cobordisms between connected surfaces with connected boundary, while 4\mathrm{HB} is the category of connected oriented 4-dimensional 2-handlebodies up to 2-deformations. For this purpose, we explicitly construct the inverse of the functor \Phi: 4\mathrm{Alg} \to 4\mathrm{HB}, where 4\mathrm{Alg} denotes the free monoidal category generated by a Bobtcheva--Piergallini Hopf algebra. As an application, we deduce an algebraic presentation of 3\mathrm{Cob} and show that it is equivalent to the one conjectured by Habiro.