Added a functional way of handling