Refactored exceptions; added timeouts