refactoring + adding tests