Fixed the issues
Refactoring