Tests + Refactoring