Cleaned up, refactored the exception handling
Cleaned up old deprecated files