Added some validation
method renamed
Introduced IOC
Unit tests