Added More Tests + small refactoring