Added tests and design changes.