Added some cleanup functions