Some Code Clean up
Tests and code clenup