Added tests + clean up