Coderefactoring and additional Tests