Change basic types (size, rect, point) to use template