Clean up & add test coverage