some cleanup + tests