more refactors
Added Error Handling system