Add ability to use type option for adding index