Merge pull request #1 from charugvvdn/restructuring

Restructuring
error handling