Getting rid of the closure on the whole code