Refactor with specs