Removed unused code. Simplified unit tests