Refactor tested