refactor funcional tests