Refactored/Added some Unit tests