Clean-up, add tests