Fix Issue: #108 & #109 : Added Mongodb name validation
Code refactoring.