Tries to refactor... failing tests