Changed back to using typeof