Reconfigurable intelligent surface (RIS) has recently emerged as a promising technology enabling next-generation wireless networks. In this paper, we develop an improved index modulation (IM) scheme by utilizing RIS to convey information. Specifically, we study an RIS-aided multiple-input single-output (MISO) system, in which the information bits are conveyed by reflection patterns of RIS rather than the conventional amplitude-phase constellation. Furthermore, the K-means algorithm is employed to optimize the reflection constellation to improve the error performance. Also, we propose a generalized Gray coding method for mapping information bits to an appropriate reflection constellation and analytically evaluate the error performance of the proposed scheme by deriving a closed-form expression of the average bit error rate (BER). Finally, numerical results verify the accuracy of our theoretical analysis as well as the substantially improved BER performance of the proposed RIS-based IM scheme.