refactoring of tests + adding tests