indexOf and some beautifications.