Moved license type index to array, and cleaned up some code