Refactor 100% tested