Fix functions which would be asynchronous and export them in order to be able to use them for the migrations