cleaning up the functions