Refactor - all tests working