Manipulating surface states in topological insulator nanoribbons